import pickle
import numpy
from matplotlib import pyplot
pyplot.ion()

image01 = pickle.load( open('image01.pkl') )
print 'Image 01 mean is:',image01.mean()

image02 = pickle.load( open('image02.pkl') )
print 'Image 02 mean is:',image02.mean()


wavelength,flux = numpy.genfromtxt('spectrum.txt',unpack=True)
new_flux = flux * 2
fig = pyplot.figure()
ax = fig.add_subplot(1,1,1)
ax.plot(wavelength,new_flux, color='green')
pyplot.draw()

fig.savefig('figure.pdf')
fig.clf()
fig = pyplot.figure()
ax = fig.add_subplot(1,1,1)
ax.imshow(image01)
pyplot.draw()
raw_input('wait...')
